package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
public class Tfyempoperation {
    private int operationId;//操作ID
    private QempFrom empId;//操作员工
    private String operationContent;//操作内容
    private Timestamp operationTime;//操作时间
    private String operationMkm;//模块名
    private String opClassmethod;//方法名
    private String opParams;//参数列表
    private String opUrl;//请求路径
    private TfyclientForm clientId;//客户表id
    private TfylinkmanForm linkmanId;//联系人表
    private TfyclueForm clueId;//线索表


    @Basic
    @Column(name = "op_url")
    public String getOpUrl() {
        return opUrl;
    }

    public void setOpUrl(String opUrl) {
        this.opUrl = opUrl;
    }

    @Basic
    @Column(name = "op_params")
    public String getOpParams() {
        return opParams;
    }

    public void setOpParams(String opParams) {
        this.opParams = opParams;
    }

    @Basic
    @Column(name = "op_classmethod")
    public String getOpClassmethod() {
        return opClassmethod;
    }

    public void setOpClassmethod(String opClassmethod) {
        this.opClassmethod = opClassmethod;
    }

    @Basic
    @Column(name = "operation_mkm")
    public String getOperationMkm() {
        return operationMkm;
    }

    public void setOperationMkm(String operationMkm) {
        this.operationMkm = operationMkm;
    }

    @Id
    @Column(name = "operation_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "seq")
    public int getOperationId() {
        return operationId;
    }

    public void setOperationId(int operationId) {
        this.operationId = operationId;
    }

    //操作多对员工一
    @ManyToOne
    @JoinColumn(name="emp_id")
    public QempFrom getEmpId() {
        return empId;
    }

    public void setEmpId(QempFrom empId) {
        this.empId = empId;
    }

    //操作多对客户一
    @ManyToOne
    @JoinColumn(name = "client_id")
    public TfyclientForm getClientId() {
        return clientId;
    }

    public void setClientId(TfyclientForm clientId) {
        this.clientId = clientId;
    }

    //操作多对联系人一
    @ManyToOne
    @JoinColumn(name = "linkman_id")
    public TfylinkmanForm getLinkmanId() {
        return linkmanId;
    }

    public void setLinkmanId(TfylinkmanForm linkmanId) {
        this.linkmanId = linkmanId;
    }

    //操作多对线索一
    @ManyToOne
    @JoinColumn(name = "clue_id")
    public TfyclueForm getClueId() {
        return clueId;
    }

    public void setClueId(TfyclueForm clueId) {
        this.clueId = clueId;
    }

    @Basic
    @Column(name = "operation_content")
    public String getOperationContent() {
        return operationContent;
    }

    public void setOperationContent(String operationContent) {
        this.operationContent = operationContent;
    }

    @Basic
    @Column(name = "operation_time")
    public Timestamp getOperationTime() {
        return operationTime;
    }

    public void setOperationTime(Timestamp operationTime) {
        this.operationTime = operationTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Tfyempoperation that = (Tfyempoperation) o;
        return operationId == that.operationId &&
                Objects.equals(operationContent, that.operationContent) &&
                Objects.equals(operationTime, that.operationTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(operationId, operationContent, operationTime);
    }
}
